﻿namespace Example.Creational.Builder
{
    public sealed class CalculatorResultBuilder : ResultBuilder
    {
        public CalculatorResultBuilder()
            : base(new Calculator())
        {
        }

        public override void Add(decimal value)
        {
            var calculator = (Calculator)Result;
            calculator.Total += value;
        }

        public override void Subtract(decimal value)
        {
            var calculator = (Calculator)Result;
            calculator.Total -= value;
        }
    }
}